// 使用js调用python程序，为以后界面调用python
const fs=require('fs');
const child_process=require('child_process');
var python=child_process.spawn('python',['C:/hashaki/work/hashaki/hashakisea/run2.py']);
python.stdout.on('data',function(data){
    console.log('输出：'+data);
});
python.stderr.on('data',function(data){
    console.log("hashaki"+data);
}
);
python.on('data',function(data){
    console.log(data)
});
/*   python调用例子
if __name__=='__main__':
    from time import sleep
    for i in range(10):
        print("hashaki")
        sys.stdout.flush()
        assert 1==2
        sys.stderr.flush()
        sleep(1)
        print(i)
*/